package com.torry.edss.api.controller;

import com.torry.edss.application.biz.SyncDataBiz;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/sync")
@Api(tags = "数据同步接口")
public class SyncDataController {


    @Resource
    private SyncDataBiz syncDataBiz;

    @ApiOperation(value = "同步两市股票")
    @GetMapping("syncAllCompanies")
    public Boolean syncAllCompanies() {
        return syncDataBiz.syncAllCompanies();
    }

    @ApiOperation(value = "同步指定日期涨停股池")
    @GetMapping("syncLimitUps/{date}")
    public Boolean syncLimitUps(@PathVariable String date) {
        return syncDataBiz.syncLimitUps(date);
    }
}
